<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{ message }}</h1>
        <!-- v-bind 是单向 -->
        <input type="text" :value="message">
        <hr>
        <button @click="console.log(message)" >print</button>
        <hr>
        <button @click="message='测试'" >修改message</button>
        
        <h3>事件对象 $event, 效果看控制台:</h3>
        <input type="text" @input="console.log($event.target.value)" >
        <h3>获取输入内容赋值给message:</h3>
        <input type="text" @input="message = $event.target.value" >
    </div>

    <script src="./vue.global.prod.js"></script>
    <script>
        const { createApp } = Vue;
        createApp({
            data:  function () {
                return {
                    message: 'Hello Vue!',
                    
                };
            }
        }).mount('#app');
    </script>
</body>

</html>